package com.huabo.contract.util;

import com.huabo.contract.oracle.entity.TblOrganization;
import com.huabo.contract.oracle.entity.TblStaff;
import com.huabo.contract.service.TblAttachmentService;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Observer;
import java.util.ResourceBundle;

public class BaseController {


    @Resource
    public HttpServletRequest request;

    @Resource
    public Observer observer;

    @Resource
    public TblAttachmentService tblAttachmentService;

    public static final String frbi = ResourceBundle.getBundle("setting/jdbc").getString("frbi").toString();


    public BaseController() {
    }


    public TblOrganization getCurrentOrg() {
        return (TblOrganization)this.request.getSession().getAttribute("hbOrgEntity");
    }

    public TblStaff getTblStaff() {
        TblStaff tblStaff = (TblStaff)this.request.getSession().getAttribute("longUser");
        return tblStaff;
    }

    public void setErrorJsp(String data) {
        this.request.getSession().removeAttribute("ErrorJsp");
        this.request.getSession().setAttribute("ErrorJsp", data);
    }
}
